package com.ztorn.cdc;

import com.ztorn.common.model.FlinkCDCConfig;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.List;
import java.util.Map;

public interface CDCBuilder {

    String getHandle();

    CDCBuilder create(FlinkCDCConfig config);

    DataStreamSource<String> build(StreamExecutionEnvironment env);

    List<String> getSchemaList();

    List<String> getTableList();

    Map<String, Map<String, String>> parseMetaDataConfigs();

    String getSchemaFieldName();

    default Map<String, String> parseMetaDataConfig() {
        throw new RuntimeException("此数据源并未实现分库分表");
    }
}
